package com.sg.business.visualization.view.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.handlers.HandlerUtil;

import com.sg.business.visualization.ui.DeliveryOfWork;

public class ExcludeSummaryWork extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		IWorkbenchPart part = HandlerUtil.getActivePart(event);
		if (part instanceof DeliveryOfWork) {
			DeliveryOfWork view = (DeliveryOfWork) part;
			view.setExcludeSummaryWork(!view.isExcludeSummaryWork());
			view.doRefresh();
		}
		return null;
	}
}
